UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5/vpZ2F6XnCGPTj/Imo/8r6C9SSkzPtsnZS9QwY0KvI='
WHERE
key_id = '9fc2b243d4235b3fe737450cf125a13b4e05a6ef119425bdbcd0d844930f6834'
AND (
token = '5/vpZ2F6XnCGPTj/Imo/8r6C9SSkzPtsnZS9QwY0KvI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)