UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uphs1vwvm0yV/flqQFIGRa3dePTy7e60ZIgMZQuAcA8='
WHERE
key_id = '68bcf3238dce07c71dc280d26489c656d611579510aca8889d83f1803284b6bb'
AND (
token = 'Uphs1vwvm0yV/flqQFIGRa3dePTy7e60ZIgMZQuAcA8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)