UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IBx61IPNQW2/YrO/LuklG21WmFa3oo2OLVIS1f+4IAU='
WHERE
key_id = 'd4f90757942010773737a22bc8569528190590ab200e0460cc79cc75e978924d'
AND (
token = 'IBx61IPNQW2/YrO/LuklG21WmFa3oo2OLVIS1f+4IAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)