UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hFCS9qmoVPyLm86QYJPBrCTdwxn5DWLLxWQf3FEXqiw='
WHERE
key_id = '605dc7b567bbe62322e305327605f5f52eb4cc823ba3249f9733da9eebb2f831'
AND (
token = 'hFCS9qmoVPyLm86QYJPBrCTdwxn5DWLLxWQf3FEXqiw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)