UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jdmFKzYM6qM/2KSX12hkC3Dj5hUfrYxcg/0lcieyyAQ='
WHERE
key_id = 'c0cded2b2fe8571e0b10ba3d1a2a628710b6f372278a6563370926c2afdcde32'
AND (
token = 'jdmFKzYM6qM/2KSX12hkC3Dj5hUfrYxcg/0lcieyyAQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)