UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DzIEXdND4El9FR0+oE2K2X9zyAAGaAFvYupLf/uKIDc='
WHERE
key_id = 'abc33bc9f22f5b13fb0a66ab0b73ddeda938bf1c55fdd4d4e429a1145aa0337f'
AND (
token = 'DzIEXdND4El9FR0+oE2K2X9zyAAGaAFvYupLf/uKIDc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)