UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+xQXCE76wVdOpbtxbA9KOiTefYUXN/bulViIe/JjlGE='
WHERE
key_id = 'cf5ad77f34f87b668c73c43ca1fbbbfe21dfa934e5241be1c0bbf72235488a66'
AND (
token = '+xQXCE76wVdOpbtxbA9KOiTefYUXN/bulViIe/JjlGE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)