UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FUcA44nZ1eKRalu/MgAG2dG793d+wIjmFO7X1LmEjJs=' 
WHERE 
  key_id = '4210ac34fb220e78e0f47449fa10a96cb77490b94b7805ebb1d22eddf1d086cf' 
  AND (
    token = 'FUcA44nZ1eKRalu/MgAG2dG793d+wIjmFO7X1LmEjJs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031