UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EDcOVezAVXmtvv82pKv4PXeAWLpZYRNfOCSO6PAsMeI='
WHERE
key_id = '5ef8e6dee1ea65eb12dd94ce8bfff04e83337b2569a4da57ade50bfd2e232afc'
AND (
token = 'EDcOVezAVXmtvv82pKv4PXeAWLpZYRNfOCSO6PAsMeI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)