UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uFiKbW9y9xfX7HL86rmRw/i8SfhSPapR7yBzA7FHOh8=' 
WHERE 
  key_id = '66cd9301a15688031d255c21d0d73eb38170bb0b1ee0c58116f6d5ed713a6bdf' 
  AND (
    token = 'uFiKbW9y9xfX7HL86rmRw/i8SfhSPapR7yBzA7FHOh8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042