UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y6aw5Smvh63FkbWLBT0IBnXwTCCEAdah0Otb/TyCwi4='
WHERE
key_id = '3b19bbf3a3bc6ebc9153d595807c7168a6cc9b5968651fadd1aef895e666ed67'
AND (
token = 'Y6aw5Smvh63FkbWLBT0IBnXwTCCEAdah0Otb/TyCwi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)