UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1JE6S1udVZDe/3T1YDmOXgvF2v6oG8h7vVqVF3A65rQ='
WHERE
key_id = '4ce3724a69be9f9772884558cbe46e0e7294a239182a7750065be6d7293be418'
AND (
token = '1JE6S1udVZDe/3T1YDmOXgvF2v6oG8h7vVqVF3A65rQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)