UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zpERjR6NMgBCkQfGFirYPWt3/VtsBuT6lYG81NaUDJM=' 
WHERE 
  key_id = 'bf8fc5b45ba9e018ec6e2070fd7987a4a2d210eace259d30318ee5f7b664d0e7' 
  AND (
    token = 'zpERjR6NMgBCkQfGFirYPWt3/VtsBuT6lYG81NaUDJM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017