UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1oESFznibXObFRaVkGu9FshUA0kFpe+GLtaUrQH60v4='
WHERE
key_id = 'b2ad416e471bc74a434550af85fa4561c49ea5ca7e2965d32794efa0581604c3'
AND (
token = '1oESFznibXObFRaVkGu9FshUA0kFpe+GLtaUrQH60v4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)