UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qqakd5iPq5hBu2kiYneCYJtTJrG0TeRj74lnOONRg3A='
WHERE
key_id = '6cefea6cd446da289b43a6786cc155a8c051e49a73b0cc1a11444e6b0ece3c0d'
AND (
token = 'Qqakd5iPq5hBu2kiYneCYJtTJrG0TeRj74lnOONRg3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)