UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1TaOp889WFNILkVRxdi507xvHXDtbzudiEx0TUVpE34='
WHERE
key_id = 'a075653609c9275d41078e972bb83aa83d5f5256bdb5bde1fcd9ce94b0a1c7e4'
AND (
token = '1TaOp889WFNILkVRxdi507xvHXDtbzudiEx0TUVpE34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)