UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o7nROTQ1MKSVbGOy3eAiU3D6Tc7ispvpZvrpw2N0Hck='
WHERE
key_id = 'd7b9b19cd1139901c97395cd2dde0a669e4b5cb0c07cb3a1957cdf9b3ef0a928'
AND (
token = 'o7nROTQ1MKSVbGOy3eAiU3D6Tc7ispvpZvrpw2N0Hck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)