UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i2ilsP/5uerW/xZd0yQbJVQBHWsBrYUfEumhKn5Ocdg='
WHERE
key_id = '02f1dc4d6447d74063145b79840d0fdb73962747a36a0f022ce4ff337e049fb1'
AND (
token = 'i2ilsP/5uerW/xZd0yQbJVQBHWsBrYUfEumhKn5Ocdg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)