UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UCI6ON7euRWTavsQZCBwqvUEv5cgavgLybeGN6CH54A=' 
WHERE 
  key_id = '79496b32c87de37db8f356a1480dcc5fe485243a31be14101354e6a11ac90150' 
  AND (
    token = 'UCI6ON7euRWTavsQZCBwqvUEv5cgavgLybeGN6CH54A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033