UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/l6oqcFuFUO8Juh1ubWwGAD7nvWyDa67i68sTFgI7QU='
WHERE
key_id = '0f4ca6b734583d1db0162c15f21aebc9c998f3abb5fe7cb7b96d37c34a028cf8'
AND (
token = '/l6oqcFuFUO8Juh1ubWwGAD7nvWyDa67i68sTFgI7QU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)