UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fBkWVQfgojazIjz8vUA+ZNHt5jFs2pc/eWcA6oeDmNM='
WHERE
key_id = '04962e8087c0337b8ea501b0cfd91dc815954d624b384a4b4487fdf530e7ff99'
AND (
token = 'fBkWVQfgojazIjz8vUA+ZNHt5jFs2pc/eWcA6oeDmNM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)