UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'escvW3YwlFNuv3muOp/fmdMMij/awG6nIcOmXZuNOGU='
WHERE
key_id = 'c1e8796e35b6fc38fd0fb67bf4931910721a5f00092aa58cfb1f1a42e22f485c'
AND (
token = 'escvW3YwlFNuv3muOp/fmdMMij/awG6nIcOmXZuNOGU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)