UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G6MWfV5f4ilfdOKTz2oKaZIljawudGF38TnRtjWpPDA='
WHERE
key_id = '35e11013aab93fa0b1901556e1fcdb1821aec409da525c58f3ae2fd02af517ec'
AND (
token = 'G6MWfV5f4ilfdOKTz2oKaZIljawudGF38TnRtjWpPDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)