UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oi6tSg8ZtTTvHuCpFvxRUZ8CRVF652Yz2i4tZi1rZ4U='
WHERE
key_id = '6eb5c6ffa2772bda7e2f4eb0be9dfa7e061c0394865ab251f889d507c9eacec6'
AND (
token = 'oi6tSg8ZtTTvHuCpFvxRUZ8CRVF652Yz2i4tZi1rZ4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)