UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0kGYvh5ybb0AHPaGVqqZ4/LSRj+w/CnE+f1hQmXwGhU='
WHERE
key_id = '860cfb858decfedb7a65d2095f183de429aa10721a715cd4979ba64156ac765c'
AND (
token = '0kGYvh5ybb0AHPaGVqqZ4/LSRj+w/CnE+f1hQmXwGhU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)