UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7MVLiF8TcZEte0+Rl51tDk4Zke6HYGITxrumwbYB1gI=' 
WHERE 
  key_id = 'b5c830adc76fa73db7aeda07a3ff15ec164e7b66d2a1b9a855a2460ae6d0784b' 
  AND (
    token = '7MVLiF8TcZEte0+Rl51tDk4Zke6HYGITxrumwbYB1gI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034