UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ITpLFGxkL0doQnna2gjaBw7ZlyU2A1Ue8E89m7wbXNk='
WHERE
key_id = '4391af325c2d7e3f6477332a33a99d69800036ee6e2312fd5042318488237140'
AND (
token = 'ITpLFGxkL0doQnna2gjaBw7ZlyU2A1Ue8E89m7wbXNk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)