UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XQ3j0aW48FZB9HbW9Yt/sNkq4L8zZ6/yT/6gzFvsZYw='
WHERE
key_id = '6f7695cc8effc79a1fa465972f8addc6f478d7ed89504913d689be7c859400e7'
AND (
token = 'XQ3j0aW48FZB9HbW9Yt/sNkq4L8zZ6/yT/6gzFvsZYw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)