UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3pqes7QnmXnN7v1nyLJ9y0+RML5Ewny2TAafHsAS8CU='
WHERE
key_id = '3f8f1a0318fea33154d2bc52f6adb084961ab4f6b00659a4b9756a45bf445293'
AND (
token = '3pqes7QnmXnN7v1nyLJ9y0+RML5Ewny2TAafHsAS8CU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)