UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ahSqU4XtKRxk+FTDiKXVoi6P70QoF96zfzdS/MdSQtA=' 
WHERE 
  key_id = '35660ccbef29042fb6bb9f0eeb05d585e8f2a61f436a0c1ccc3ff22669a70214' 
  AND (
    token = 'ahSqU4XtKRxk+FTDiKXVoi6P70QoF96zfzdS/MdSQtA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037