UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ad05PpeBNQN0DzI8i1MlsKi/bHyh3vQy1tAZ4BHXDCk=' 
WHERE 
  key_id = '342b091e4ebc254a8b34fc480c970c9c69bf88eb131eea28da262b66012d7898' 
  AND (
    token = 'Ad05PpeBNQN0DzI8i1MlsKi/bHyh3vQy1tAZ4BHXDCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034