UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TDXdpjkEQfmc6TXPtAq9EkKk14athdLC2caBDIWL/lA='
WHERE
key_id = 'de262b27cb4fa5717c08c17b05743359405fb824839803dbd500dd6293624adf'
AND (
token = 'TDXdpjkEQfmc6TXPtAq9EkKk14athdLC2caBDIWL/lA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)