UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AuqqaiPZoSmeGduJ/VmM3cnCYl7yY5NeMCE8OllWhwA='
WHERE
key_id = '6da0530b0bf3dcd98b2d0303dda1c9544c6d7c2a9e2397630aed1d4468892ffc'
AND (
token = 'AuqqaiPZoSmeGduJ/VmM3cnCYl7yY5NeMCE8OllWhwA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)