UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5tjzM/uScpDqyQ1SauWKKNSY/Ehn3KQzEVI8+z1K0G8='
WHERE
key_id = 'a03d7d3da1bb202857e72118bf96c3d66a6b482b1490e18f0536c0386e491d62'
AND (
token = '5tjzM/uScpDqyQ1SauWKKNSY/Ehn3KQzEVI8+z1K0G8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)