UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/cOAHhuxKlal3D2zQTCIbQCsAPFINY9sC6bX+d2mZ2s=' 
WHERE 
  key_id = '61c4726f73de3cee7eb191efb5762552cfbd36152158f8c8502c45d528d9a175' 
  AND (
    token = '/cOAHhuxKlal3D2zQTCIbQCsAPFINY9sC6bX+d2mZ2s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027