UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ePxDWuNTG5kca3nqkcpBtgmaAEZrT6Hxf5rBPYDkHBA=' 
WHERE 
  key_id = '85eea478e1a751340c787f34b2dcac6228864dd495937a14212e196eb68ececa' 
  AND (
    token = 'ePxDWuNTG5kca3nqkcpBtgmaAEZrT6Hxf5rBPYDkHBA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032